const state = {
  infoBoxShow: false,
  infoBoxData: [],
  infoBoxLeftVal: null,
  infoBoxTopVal: null
}

const mutations = {
  setInfoBoxShow: (state, infoBoxShow) => {
    state.infoBoxShow = infoBoxShow
  },
  setInfoBoxData: (state, infoBoxData) => {
    state.infoBoxData = infoBoxData
  },
  setInfoBoxLeftVal: (state, infoBoxLeftVal) => {
    state.infoBoxLeftVal = infoBoxLeftVal
  },
  setInfoBoxTopVal: (state, infoBoxTopVal) => {
    state.infoBoxTopVal = infoBoxTopVal
  }
}

const actions = {
  setInfoBoxShowFun({ commit }, infoBoxShow) {
    commit('setInfoBoxShow', infoBoxShow)
  },
  setInfoBoxDataFun({ commit }, infoBoxData) {
    commit('setInfoBoxData', infoBoxData)
  },
  setInfoBoxLeftValFun({ commit }, infoBoxLeftVal) {
    commit('setInfoBoxLeftVal', infoBoxLeftVal)
  },
  setInfoBoxTopValFun({ commit }, infoBoxTopVal) {
    commit('setInfoBoxTopVal', infoBoxTopVal)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
